home *** CD-ROM | disk | FTP | other *** search
- DPaint IV enhanced color cycle chunk (EA)
-
- DRNG Chunk for FORM ILBM
- ========================
-
- Submitted by Lee Taran
-
- Purpose:
-
- Enhanced Color Cycling Capabilities
- -------------------------------------
- * DPaintIV supports a new color cycling model which does NOT
- require that color cycles contain a contiguous range of color
- registers.
-
- For example:
- If your range looks like: [1][3][8][2]
- then at each cycle tick
- temp = [2],
- [2] = [8],
- [8] = [3],
- [3] = [1],
- [1] = temp
-
- * You can now cycle a single register thru a series of rgb values.
- For example:
- If your range looks like: [1] [orange] [blue] [purple]
- then at each cycle tick color register 1 will take on the
- next color in the cycle.
-
- ie: t=0: [1] = curpal[1]
- t=1: [1] = purple
- t=2: [1] = blue
- t=3: [1] = orange
- t=4: goto t=0
-
- * You can combine rgb cycling with traditional color cycling.
- For example:
- Your range can look like:
- [1] [orange] [blue] [2] [green] [yellow]
-
- t=0: [1] = curpal[1], [2] = curpal[2]
- t=1: [1] = yellow, [2] = blue
- t=2: [1] = green, [2] = orange
- t=3: [1] = curpal[2], [2] = curpal[1]
- t=4: [1] = blue, [2] = yellow
- t=5: [1] = orange, [2] = green
- t=6: goto t=0
-
- Note:
- * DPaint will save out an old style range CRNG if the range fits
- the CRNG model otherwise it will save out a DRNG chunk.
- * no thought has been given (yet) to interlocking cycles
-
-
-
- /* ---------------------------------------------------------------------
-
- IFF Information: DPaintIV DRNG chunk
-
- DRNG ::= "DRNG" # { DRange DColor* DIndex* }
-
- a <cell> is where the color or register appears within the range
-
- The RNG_ACTIVE flags is set when the range is cyclable. A range
- should only have the RNG_ACTIVE if it:
- 1> contains at least one color register
- 2> has a defined rate
- 3> has more than one color and/or color register
- If the above conditions are met then RNG_ACTIVE is a user/program
- preference. If the bit is NOT set the program should NOT cycle the
- range.
-
- The RNG_DP_RESERVED flags should always be 0!!!
- --------------------------------------------------------------------- */
- typedef struct {
- UBYTE min; /* min cell value */
- UBYTE max; /* max cell value */
- SHORT rate; /* color cycling rate, 16384 = 60 steps/second */
- SHORT flags; /* 1=RNG_ACTIVE,4=RNG_DP_RESERVED */
- UBYTE ntrue; /* number of DColor structs to follow */
- UBYTE nregs; /* number of DIndex structs to follow */
- } DRange;
-
- typedef struct { UBYTE cell; UBYTE r,g,b; } DColor; /* true color cell */
- typedef struct { UBYTE cell; UBYTE index; } DIndex; /* color register cell */
-
-